import javax.mail.MessagingException;
import java.io.IOException;
import java.sql.SQLException;

/**
 * Created by Kobe on 2016/12/11.
 */
public class test {
    public static void main(String[] args) throws SQLException, InstantiationException, IllegalAccessException, MessagingException, IOException {
        Email e=new Email();


        emailAddress[] addresses ;
        addresses =e.getemailAddress();//get the email address from the database
        //e.sendMail(addresses[0].getAddress(),addresses[0].getName());
        e.sendMail(addresses[1].getAddress(),addresses[1].getName());
        //e.sendMail(addresses[2].getAddress(),addresses[2].getName());



        e.sendMailWithFile(addresses[1].getAddress(),addresses[1].getName(),"file/1.txt");

        e.sendMailWithImage(addresses[1].getAddress(),addresses[1].getName(),"file/2.jpg");


        //receiveMail();
    }

}
